<?php

$addonPath = realpath(dirname(__FILE__));
$addonName = 'ajaxFileUpload';

$resource = new TinyMVCResource($addonName);

require_once($addonPath . '/app/controllers/AjaxFileUploadActionController.class.php');
require_once($addonPath . '/app/model/MultiUploadHandler.class.php');

$resource->modelAndView = new TinyMVCModelAndView(new TinyMVCView(new TinyMVCPathResolver($addonPath . '/app/views/$1'), $addonName));
$resource->model = $resource->modelAndView->getModel();
$resource->view = $resource->modelAndView->getView();

$resource->controller = new AjaxFileUploadActionController($resource->modelAndView, TinyMVCHttpRequest::getInstance());

TinyMVC::getInstance()->addResource($resource);
